<template>
	<view class="main-banner" @click="todetail">
	  <view class="art-image">
		  <image src="https://mmbiz.qpic.cn/mmbiz_png/DibDUX7t8goYCeibs6FroHfag4jLSlMBcC4gLX2ribxeMOjOy4wftNngEgWBiaZcMbfdSoiaMggKeG5rzLREA8p8VMg/640?wx_fmt=png&wx_lazy=1&wx_co=1&wxfrom=5&tp=webp"></image>
	  </view>
	  <view class="banner-info">
	    <h3>{{obj.title}}</h3>
	    <text class="description">{{obj.summary}}</text>
	    <view class="meta">
	      <text class="views">{{obj.views || 30}}</text>
	      <text class="publisher">{{creater.school}}</text>
	      <text class="time">{{obj.updateTime}}</text>
	    </view>
	  </view>
	</view>
</template>

<script>
	import myrequest from "@/untils/request.js"
	export default{
		name:"bigview",
		props:{
			obj:{
				type:Object,
				default:null
			}
		},
		data(){
			return{
				boke:{
					
				},
				creater:null
			}
		},
		methods:{
			getboke(){
				
			},
			log(){
				console.log("展示区域");
				console.log(this.$props.obj);
			},
			getuser(){
				myrequest.getuserbyid(this.$store.state.token,this.$props.obj.id)
				.then(r=>{
		
					this.creater = r.data.data
				})
			},
			todetail(){
				uni.navigateTo({
					url:"/pages/router/detail/detail"
				}).then(()=>{
					uni.$emit("todetail",{obj:this.$props.obj})
				})
			}
		},
		mounted() {
			uni.$on("indexok",()=>{
				setTimeout(this.getuser,100)
			})
			
		},
		beforeDestroy() {
		
		}
	}
</script>

<style scoped>
	.main-banner {
	  border-radius: 12px;
	  overflow: hidden;
	  margin-bottom: 15px;
	  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	  transition: all .3s;
	}
	
	.main-banner:active{
		transform: translateY(-4px) scale(0.95);
		filter: brightness(0.9);
	    box-shadow: 0 4px 12px rgba(255 255, 255, 1);
	}
	
	.art-image {
	  height: 200px;
	  background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  color: white;
	  font-size: 24px;
	  font-weight: bold;
	}
	
	.art-image image{
		width: 100%;
		height: 100%;
	}
	
	.banner-info {
	  padding: 15px;
	  background-color: #fff;
	}
	
	.banner-info h3 {
	  font-size: 18px;
	  margin: 0 0 10px 0;
	}
	
	.description {
	  font-size: 14px;
	  color: #666;
	  margin-bottom: 10px;
	  line-height: 1.5;
	}
	
	.meta {
	  display: flex;
	  gap: 15px;
	  font-size: 12px;
	  color: #999;
	}
</style>